﻿<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style type="text/css">
    
    </style>
      <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
      <!-- <script src="http://192.168.1.27:8008/socket.io/socket.io.js"></script>
      <script src="http://192.168.1.27:8008/main.js"></script> -->
      <script type="text/javascript">
            //   $(function () {
            //       msgTool.validate({
            //           userId: 10001,
            //           appId: 123,
            //           md5: 'ce8fcf995cef5d433f6c3eef53114f3c'
            //       }, function (data) {
            //           console.log(data.detail);
            //       });
            //   });
  
              function queryMsg() {
                  var selectValue = $("#select_id").val();
                  var data= $("#data_id").val();
                    var dataValue= $.parseJSON(data);
                if(selectValue==0){//验证
                    msgTool.validate(dataValue, function (data) {
                      $("#result_id").val($.getJSON(data));
                  });
                } else if(selectValue==1){//发送消息
                    msgTool.sendMessage(dataValue, function (data) {
                      $("#result_id").val($.getJSON(data));
                  });
                } else if(selectValue==2){
                    msgTool.queryMessage(dataValue, function (data) {
                      $("#result_id").val($.getJSON(data));
                  });
                } else if(selectValue==2){
                    msgTool.deleteMessage(dataValue, function (data) {
                      $("#result_id").val($.getJSON(data));
                  });
                }
              }  

            //   msgTool.receiveMessageFn = function (data) {
            //       console.log(data);
            //   };
      </script>
</head>

<body>
    <form >
            <label >参数</label>
            <textarea name="data" id="data_id" style='height:80px;'></textarea>
            <select id="select_id" name="fnType"> 
                    <option value="0">验证用户</option> 
                    <option value="1">发送消息</option> 
                    <option value="2">查询消息</option> 
            </select> 
            <input type="button" name="name" value="调用方法" onclick="queryMsg();" />
            <textarea name="result" id='result_id' style='height:200px;width:200px;'></textarea>
    </form>
    
</body>

</html>